package com.hison.tandainbao.controller;

import com.hison.tandainbao.entiy.pojo.domain.TbJobType;
import com.hison.tandainbao.response.ResponseResult;
import com.hison.tandainbao.service.TbJobTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName: JobTypeController
 * @Descripiton: 工作类别添加
 * @Author: 小郑
 * @Date： 2024/3/30 9:19
 * @Version：1.8
 **/
@RestController
@RequestMapping("/jobType")
@Api(value = "职位类别信息管理接口", tags = "职位类别信息管理接口")
public class JobTypeController {

    @Autowired
    private TbJobTypeService tbJobTypeService;

    /**
     * 获取所有类型
     *
     * @return @return {@code ResponseResult }
     * @author $USER$
     * @date 2024/03/30
     * @see ResponseResult
     * @since version
     *///获取所有的类别
    @GetMapping("/getAllTypes")
    @ApiOperation(value ="获取所有的分类类别",produces = "application/json",httpMethod = "GET")
    public ResponseResult getAllTypes(){
        return  tbJobTypeService.getAllTypes();
    }


    /**
     * 删除类型
     *
     * @param typeId 类型 ID
     * @return @return {@code ResponseResult }
     * @author $USER$
     * @date 2024/03/30
     * @see String
     * @see ResponseResult
     * @since version
     *///    删除类型
    @DeleteMapping("/deleteType/{typeId}")
    @ApiOperation(value = "删除类别",produces = "application/json",httpMethod = "DELETE")
    public  ResponseResult deleteType(@PathVariable("typeId") String typeId){
        return  tbJobTypeService.deleteType(typeId);
    }


    @PutMapping("/updateType")
    @ApiOperation(value = "更新职位类别信息",produces = "application/json",httpMethod = "PUT")
    public ResponseResult updateType(@RequestBody  TbJobType type){
        return  tbJobTypeService.updateType(type);
    }
}